package com.example.wujinapi.comm;


import lombok.Getter;

public interface enumCode {

    //会员
    public enum Vip {
        General(1,"普通会员"),
        Gold(2,"Vip会员"),
        Diamond(3,"钻石会员");

        @Getter
        private Integer code;
        @Getter
        private String desc;

        Vip(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }
        public int getCode() {
            return code;
        }
        public String getValue() {return desc;}
    }





    //登录状态
    public enum Login{
        Success(200,"登录成功"),
        Fail(405,"登录失败"),
        Forbid(404,"禁止请求"),
        badToken(408,"无效的token");

        @Getter
        private Integer code;
        @Getter
        private String desc;

        Login(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }
        /*public static String valueOf(Integer code) {
            if (code == null) return "";
            for (Login type : Login.values()) {
                if (Objects.equals(type.getCode(), code)) {
                    return type.getDesc();
                }
            }
            return "";
        }*/
        public int getCode() {
            return code;
        }
        public String getValue() {return desc;}
    }




    //预约状态
    public enum onlineStatus{
        Success(200,"预约成功"),
        Fail(10086,"预约失败"),
        queue(10000,"已接受预约,排队中");

        @Getter
        private Integer code;
        @Getter
        private String desc;

        onlineStatus(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }
        public int getCode() {
            return code;
        }
        public String getValue() {return desc;}
    }




} //Class End
